﻿using BLLDominar;
using Dominar.Modelos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Dominar.Controllers
{
    public class HomeController : BaseController
    {
        public ActionResult Index()
        {
            HomeModel model = new HomeModel();
            model.Regiones = new BLLRegion().TraerRegiones();

            return View("Index", model);
        }

        public JsonResult Consultar(string dominio, int idRegion)
        {
            string region = new BLLRegion().TraerRegion(idRegion).Region;
            bool disponible = ConsultarDisponibilidadDominio(dominio, region);

            return Json(new { Disponible = disponible }, JsonRequestBehavior.AllowGet);
        }
    }
}